home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / REFERENC / TPR / TPR1.TXT < prev    next >
Text File  |  1992-12-15  |  30KB  |  977 lines

  1.  
  2.                           The Turbo Pascal Reference
  3.                                       by
  4.                                   Ed Mitchell
  5.  
  6.                                 A Freeware Book
  7.  
  8. First edition, Nov 1992. (C) Copyright 1992 by Ed Mitchell, author of the
  9. Borland Pascal Developer's Guide, Que Corporation, 1992.  
  10.  
  11.  
  12.  
  13. Introduction
  14.  
  15.      Welcome to the electronic edition of the Turbo Pascal Reference.  This
  16. reference provides approximately 400 single-spaced pages of reference
  17. information about the Turbo Pascal IDE, the Turbo Pascal language, all of the
  18. System and Graph libraries, plus a comprehensive 150+ page reference to Turbo
  19. Vision.
  20.  
  21.      This book is intended to be used as a reference - not as a tutorial.  If
  22. you have no programming experience whatsoever, you should consult a Turbo
  23. Pascal programming tutorial first.  If you have a minor amount of programming
  24. experience, you will find a complete discussion of Turbo Pascal in Chapter 3,
  25. "The Turbo Pascal Language".
  26.  
  27.      The Turbo Vision Reference section, Chapters 6 through 10, is unique in
  28. that it provides many examples and highlights the most commonly used features. 
  29. If you have programmed in Turbo Vision you already know that you do not need to
  30. use all of the methods described for each object type.  Unfortunately, it is
  31. difficult, using Borland's documentation, to discern those that are needed and
  32. those that you can safely ignore.  This means that learning Turbo Vision using
  33. the Borland documentation is much more difficult than it needs to be.  And that
  34. is why you will want to use the reference information I've provided in this
  35. freeware book.  
  36.  
  37.      If you have never programmed in Turbo Vision, I recommend that you consult
  38. Chapter 11, "Turbo Vision Tutorial", continuing though Chapter 16, of the
  39. Borland Pascal Developer's Guide, published by Que Books.
  40.  
  41.      This Turbo Pascal Reference, a 400 page book, is available to you, for
  42. free.  Subject to the copyright and distribution rights described below, you
  43. are free to copy this book and give it to others.
  44.  
  45.  
  46.  
  47. Why am I giving this book away?
  48.  
  49.      When I wrote Borland Pascal Developer's Guide (Que Books, 1992), my
  50. publisher asked for a comprehensive book that would cover every feature of
  51. Turbo Pascal.  Obviously, such a volume would take a lot more than could fit
  52. within the approximately 1,000 page limitation of a printed book.
  53.  
  54.      Because there is not room in a single volume to hold all of this material,
  55. I am giving away the extra 400 pages that it takes to flesh out the entire
  56. topic.  I want you, my reader, to have access to this text, to help you in your
  57. development of Pascal applications.  There is a great deal of valuable insight,
  58. tutorials and sample code within this text and I very much want these
  59. techniques to get into your hands and to be used by you.
  60.  
  61.      Please note that while the material presented here complements the Borland
  62. Pascal Developer's Guide, this electronic book is not in any way affiliated
  63. with the Que Corporation.
  64.  
  65.      This electronic book is completely free.  However, if you find this
  66. information of value to you, I would greatly appreciate your purchase of
  67. Borland Pascal Developer's Guide, published by Que Corporation, 1992.  (Or,
  68. alternately, my Secrets of the Borland C++ Masters (Sams Books, 1992) or Using
  69. Microsoft C/C++ (Que, 1992)).  
  70.  
  71.      This freeware book does not duplicate the material in the Borland Pascal
  72. Developer's Guide.  The Borland Pascal Developer's Guide and the Turbo Pascal
  73. Reference are completely independent of one another - yet strongly complement
  74. each other - so it is to your advantage to have access to both.  If your book
  75. store does not stock Borland Pascal Developer's Guide, you can ask your
  76. retailer to order them directly from Que Corporation, or call Que at
  77. 317-573-2500 or 1-800-428-5331.
  78.  
  79.      Because the material in the Turbo Pascal Reference was originally intended
  80. as extra chapters in the Borland Pascal Developer's Guide, you will find cross
  81. references to the Developer's Guide.  For example, in the reference section on
  82. the Turbo Vision TCollection object, I will point you to chapter 14,
  83. "Collections" in the Borland Pascal Developer's Guide for additional examples.
  84.  
  85.  
  86.  
  87. About the Author
  88.  
  89.      I am the author of Borland Pascal Developer's Guide (Que Books, 1992),
  90. coauthor of Using Microsoft C/C++ 7.0 (Que Books, 1992), Secrets of the Borland
  91. C++ Masters (Sams Books, 1992), and author of, under a pseudonym, Software
  92. Construction Set for the IBM PC (Hayden Books, 1984).  
  93.  
  94.      As a past employee of Software Publishing Corporation, I was the project
  95. manager of the best selling PFS First Choice integrated software product, and
  96. coauthor of the original PFS Write which was one of the first word processors
  97. for the IBM PC (and was also a best seller).  Both PFS Write and PFS First
  98. Choice were written in Pascal.  In the case of First Choice, the source ran to
  99. over 125,000 lines of Pascal code.  I've been writing Pascal code since my
  100. first use of an LSI-II Terak Microcomputer in 1978.
  101.  
  102.  
  103.  
  104. How to Contact the Author
  105.  
  106.      You can contact me via electronic mail to Compuserve 73317,2513 or via the
  107. Internet to 73317.2513@compuserve.com.  I promise to read all mail that I
  108. receive; realistically I cannot promise to respond to all enquiries.  You may
  109. also reach me at EdMitch@aol.com.
  110.  
  111.  
  112. Copyright  Notice
  113.  
  114.      This text is copyrighted, which means that I retain ownership and control
  115. over the right to make copies of this electronic book.  However, I give you
  116. permission to copy this electronic text and give it away, free, to others,
  117. subject to the following rules and restrictions:
  118.  
  119. 1.  This electronic book may only be copied in its entirety, unless separate
  120. permission is received from the author.
  121.  
  122. 2.  Each copy of this material, whether electronic or printed, must not be
  123. modified by you.  In particular, each copy must include this introduction, my
  124. copyright statement and the reference to Borland Pascal Developer's Guide (Que,
  125. 1992).
  126.  
  127. 3.  You may print out copies of this electronic text for your own use.
  128.  
  129. 4.  Teachers and instructors are encouraged to copy, or to print and use this
  130. material in their classroom; however, if material is extracted for use in a
  131. classroom setting, the extracted material must bear the following notice:
  132.  
  133.      From Turbo Pascal Reference, (C) Copyright 1992 by Ed
  134.      Mitchell, author of Borland Pascal Developer's Guide, Que
  135.      Corporation, 1992.
  136.  
  137. 5.  Bona fide shareware distributors may charge a "nominal" fee for the costs
  138. of duplication and distribution.  By "nominal", I mean a low fee such as $5.00
  139. per disk.
  140.  
  141. 6.  You may not sell copies of the Turbo Pascal Reference in electronic,
  142. printed or any other form, for profit or not-for profit.
  143.  
  144. 7.  You may not give this material away or distribute this freeware text as a
  145. promotion for any other product without the express written permission of Ed
  146. Mitchell.
  147.  
  148. 8.  Turbo Pascal, Turbo Pascal for Windows, and Borland Pascal are trademarks
  149. of Borland International, Inc.
  150.  
  151.  
  152.  
  153. Disclaimer:  There are No Warranties
  154.  
  155.      The material in this electronic book has not been professionally edited. 
  156. In particular, Turbo Pascal Reference is not produced by nor sanctioned by the
  157. Que Corporation.  Que Corporation has no affiliation with nor responsibility
  158. for the content of Turbo Pascal Reference.  Ed Mitchell is solely responsible
  159. for the content of Turbo Pascal Reference.
  160.  
  161.      This means that the text has NOT been reviewed by one or more copy editors
  162. and a technical editor, which is typical of the material that you read in a
  163. published book.  As such, you may find typographical or grammatical errors. 
  164. There may also be technical errors of the type that crop up during any big
  165. project as large as this one.  If you find a problem, please notify me
  166. directly, via electronic mail, and I will fix the problem for a subsequent
  167. release of this electronic book. 
  168.  
  169.      The text and sample programs are intended solely for educational purposes.
  170. While the programs are believed to reasonably accurate and functional, they
  171. have not been subjected to the standards of a professional software quality
  172. assurance department.  No warranties, expressed or implied, are given.  This
  173. material is used by you "as is".  You may use the sample code in your own
  174. applications but you must subject the sample code to the same testing that you
  175. would give to your own code.
  176.  
  177.  
  178. About Borland Pascal Developer's Guide
  179.  
  180.      The Borland Pascal Developer's Guide is aimed at the intermediate to
  181. advanced Pascal programmer, although it contains an enormous amount of
  182. information that will be of value to those who have just learned Turbo Pascal. 
  183. The Guide covers Turbo Pascal 6.0, Turbo Pascal 7.0, Borland Pascal, including
  184. the new protected-mode features, and Turbo Pascal for Windows.  The book
  185. includes a companion disk containing all of the source code from the book, plus
  186. several shareware utilities.  A detailed outline of the Borland Pascal
  187. Developer's Guide is presented after the Table of Contents for the Turbo Pascal
  188. Reference.
  189.  
  190.  
  191. About the Illustrations and Sample Source Code
  192.  
  193.      In some of the chapters you will see reference to "figures", such as
  194. "Figure 3.2".  Above the Figure caption you will see a notation similar to:
  195.  
  196. ***03tpr02.pcx***
  197.  
  198.      This notation means that the illustration is contained in "pcx" format
  199. graphics file named 03TPR02.PCX.  You can read and print .pcx files using the
  200. Microsoft PaintBrush program that comes with Microsoft Windows.  Many other
  201. graphics programs can also display and print these .pcx format files.  All of
  202. the .pcx files are included in this electronic book.
  203.  
  204.      The text contains many program listings.  Some of these are also provided
  205. as separate source code files to make it easy for you to use the sample code in
  206. your own programs.  Whenever you see a listing in the text that contains "line
  207. numbers" on the left hand side, the topmost line of the listing will show the
  208. name of the file containing the source code.  The sample files are included in
  209. this electronic book.  The line numbers are for reference only; if you choose
  210. to type in any of the sample programs, do not type the line numbers.
  211.  
  212.  
  213.  
  214.                             Turbo Pascal Reference 
  215.                              ---------------------
  216.  
  217.                                Table of Contents
  218.                     ---------------------------------------
  219.  
  220. Total pages in the electronic book:
  221.      Over 400 single spaced pages.
  222.  
  223. Chapter 1
  224. 20 pages.
  225. This introduction
  226. Copyright information
  227. Table of Contents for Turbo Pascal Reference
  228. Table of Contents for Borland Pascal Developer's Guide
  229.  
  230.  
  231.  
  232. Chapter 2
  233. The Integrated Development Environment
  234. 36 pages.
  235.  
  236. Using the Integrated Development Environment
  237.      When to Use the IDE?
  238.      Starting Turbo Pascal's IDE
  239.      Selecting Menu Items
  240.      Editing, Saving and Compiling a Program
  241. Dialog Boxes
  242. Using the Editor
  243.      Navigating in the Editor
  244.      Selecting Text and Text Block Operations
  245.      Specific Editing Commands
  246. The IDE Help System
  247.      Copying Text from the Help system
  248. The File Menu
  249.      File Menu/Open
  250.      File Menu/New  
  251.      File Menu/Save functions
  252.      File Menu/Change dir
  253.      File Menu/Print
  254.      File Menu/Get Info
  255.      File Menu/DOS Shell
  256.      File Menu/Exit
  257. The Search Menu
  258.      Search Menu/Find (Ctrl-Q-F)
  259.      Search Menu/Replace (Ctrl-A)
  260.      Search Menu/Search Again (Ctrl-L)
  261.      Search Menu/Go to Line Number
  262.      Search Menu/Find Procedure
  263.      Search Menu/Find Error (Alt-F8)
  264. The Run Menu
  265.      Run Menu/Run (Alt-R)
  266.      Run Menu/Program Reset (Ctrl-F2)
  267.      Run Menu/Go to Cursor (F4)
  268.      Run Menu/Trace Into (F7) and Step Over (F8)
  269.      Run Menu/Parameters
  270. The Compile Menu
  271.      Compile Menu/Compile (Alt-F9)
  272.      Compile Menu/Make (F9)
  273.      Compile Menu/Build
  274.      Compile Menu/Destination
  275.      Compile Menu/Primary File
  276. The Debug Menu and the Built-in Debugger
  277.      Debug Menu/Evaluate/Modify (Ctrl-F4)
  278.      Debug Menu/Watches
  279.      Debug/Watches - Add Watch (Ctrl-F7)
  280.      Debug Menu/Watches - Delete Watch
  281.      Debug Menu/Watches - Edit Watch
  282.      Debug Menu/Watches-Remove all Watches
  283.      Debug Menu/Toggle Breakpoint (Ctrl-F8)
  284.      Debug Menu/Breakpoints
  285.           Edit Breakpoints Button
  286.           Delete Button
  287.           View Button
  288.           Clear All Button
  289. The Options Menu
  290.      Options Menu/Compiler
  291.      Options Menu/Memory sizes
  292.      Options Menu/Linker
  293.      Options Menu/Debugger
  294.      Options Menu/Directories
  295.      Options Menu/Environment
  296.           Options Menu/Environment - Preferences
  297.           Options Menu/Environment - Editor Options
  298.           Options Menu/Environment - Mouse
  299.           Options Menu/Environment - Startup
  300.           Options Menu/Environment - colors
  301.           Options Menu/Save options
  302. The Window Menu
  303.  
  304.  
  305. Chapter 3
  306. The Turbo Pascal Language
  307. 104 pages.
  308.  
  309. Your First Turbo Pascal Program
  310. Pascal Program Structure
  311. Pascal Data Types
  312.      A Note on the Use of Floating Point Values
  313.      Declaring Identifiers
  314.      Constants
  315.      Variables
  316.      Arrays
  317.      Multidimensional Arrays
  318.           Arrays and the packed Keyword
  319.      Enumerated Types
  320.      Subrange Types
  321.      Sets
  322.           Set Relational Operators
  323.           Set Logical Operators
  324.      Records
  325.           The With Statement
  326.           Record Types
  327.      Case-variant records
  328.      File Types
  329.      Typed Constants:  Pre-initialized variables
  330.      The Pointer Type
  331.           Defining and Allocating a Pointer
  332.           Using a Pointer
  333.           Disposing of a Dynamic variable
  334.           Common problems when using pointers
  335.           The Use of Mark and Release Procedures
  336.           Cautions concerning the use of Mark and Release
  337.           The Use of GetMem and FreeMem procedures
  338.           Pointers and Memory Management
  339.           Pointer Relational Operators
  340.           The Address-of operator @
  341.           @ and Procedures and Functions
  342.           @ and Procedure Value parameters
  343.           @ and Procedure Variable parameters
  344.      Summary of Pointer Operations
  345.      Pointers and Complex Data Structures
  346.      Pointers and the With Statement
  347. Turbo Pascal Arithmetic Operations
  348.      Basic Arithmetic Operators
  349.      Mixing Data Types in Expressions
  350.      Implicit Type Conversion
  351.      Explicit Type Conversion
  352.      Address-of @ operator
  353. Comparision or Relational Operators
  354.      Logical or Bit Level Operations
  355.      Boolean Operations
  356.      Short-Circuit versus Complete Evaluation
  357. String Operations
  358. Evaluation Hierarchy
  359. Pascal Statements
  360.      Program Comments
  361.      Assignment Statements:  :=
  362.      Conditional Statements:  If-then-else and case
  363.           The if-then and if-then-else statements
  364.           The case Statement
  365.      Looping Statements:  For, While and Repeat
  366.           For Loop
  367.           While Loop
  368.           Repeat Loop
  369.      Labels and Goto
  370. Procedures and Functions
  371.      Procedures
  372.           The <Optional parameter list>
  373.           Arrays as Parameters
  374.           Strings as Parameters
  375.           Records as Parameters
  376.           Summary of Using Parameter Values and Variables
  377.      The Procedure Body
  378.           Forward declared procedures
  379.           Near and Far procedure call models
  380.           Interrupt Procedures
  381.           Assembly language procedures:  External, Inline and Asm
  382.      Functions
  383.           Calling a function
  384.           Assigning a value to a function identifier
  385.           Acceptable Function Return Values
  386.           Recursive functions
  387.           The effect of short-circuit evaluation on functions
  388.      Procedures and Functions as Parameters
  389. Conditional Compilation
  390.      Built-in Conditional Compilation Symbols
  391. Compiler Directives
  392. Disk File Operations
  393.      Defining a File Identifier
  394.      Opening a File
  395.      Writing and Reading File Data
  396.      Checking for File-related Errors
  397.      Text Files
  398.      Sequential Access Data Files
  399.      Random Access Data Files
  400.      Writing Pointer values to disk files
  401.      BlockRead and BlockWrite:  The Use of Untyped Files
  402.      Specifying Different Block Sizes
  403.      Maximum buffer size and maximum data to read or write
  404.      Other File Operations
  405. Turbo Pascal Memory Limitations
  406.  
  407.  
  408.  
  409. Chapter 4
  410. System Library Reference
  411. 89 pages.
  412.  
  413.  
  414. Chapter 5
  415. Graph Library Reference
  416. 54 pages.
  417.  
  418.  
  419.  
  420. Chapter 6
  421. The Turbo Vision Reference
  422. 34 pages.
  423.  
  424. About the Reference Section
  425. Naming Conventions
  426. Naming Conventions
  427. The Turbo Vision Object Hierarchy
  428. The Reference Section
  429.      Contains reference information on every aspect of Turbo Vision, including
  430. object types, global variables, type declarations, constants, plus examples and
  431. an overview of commonly used features.
  432.  
  433. Chapter 7, 8, 9 and 10
  434. The Turbo Vision Reference
  435. (continued)
  436. Chapter 7: 28 pages.
  437. Chapter 8: 42 pages.
  438. Chapter 9: 40 pages.
  439. Chapter 10: 37 pages.
  440.  
  441.  
  442.  
  443.  
  444.  
  445.                        Borland Pascal Developer's Guide 
  446.                         -------------------------------
  447.  
  448.                                Table of Contents
  449.                     ---------------------------------------
  450.  
  451. Chapter 1
  452. Introduction
  453.  
  454.  
  455. Who Should Use This Book?
  456. How To Use This Book
  457. About the Sample Programs
  458. About The Programming Style Used in This Book
  459. The Companion Diskette
  460. How to Contact the Author
  461. New Features in Borland Pascal and Turbo Pascal 7.0
  462.      Which Compiler Should You Use?
  463.      Using Protected-Mode 
  464.      Compiling for Protected Mode
  465. Issues of Programming Style
  466.      Capitalization of Keywords
  467.      Indenting
  468.           Where to Indent?
  469.      Use Blank Lines
  470.      Types and Pointers
  471.      Procedures and Functions
  472.  
  473.  
  474.  
  475. Chapter 2
  476. Units
  477.  
  478. Introduction
  479. Structure of a Unit
  480. Defining the Interface Section
  481. Inline Procedures and Functions
  482. Using Other Units Within the Interface Section
  483. Defining the Implementation Section
  484. The Unit Initialization Section
  485. Using a Unit in another Program
  486. Compiling a Unit
  487. Using TPUMOVER to Update TURBO.TPL
  488. Multiple .TPL Library Files
  489. Project Management:  The Build and Make Options
  490. Circular References:  When Units Use Each Other
  491. Sharing Declarations Between Units
  492. The Standard Turbo Pascal Units
  493. Library Units Available From Other Suppliers
  494. A Sample Unit
  495. Dynamic Link Libraries
  496.  
  497.  
  498.  
  499. Chapter 3
  500. Overlays
  501.  
  502. Introduction
  503. General Guidelines
  504. Overlay Example
  505. Description of Example Program OverDemo
  506. Checking OvrResult
  507. Combining .OVR and .EXE into a single .EXE file
  508. Assembly language and Overlay Calls
  509. Overlays and Unit Initialization Code
  510. Overlaying Data
  511. Tuning the Virtual Array Code
  512. Turbo Pascal Overlay Unit Reference
  513.  
  514.  
  515.  
  516. Chapter 4
  517. Object-Oriented Programming
  518.  
  519. Introduction
  520. What You Need To Learn
  521. The Terminology of Object-oriented Programming
  522. A First Look at Object Oriented Programming in Turbo Pascal
  523. Pointers to Objects and Dynamic Object Allocations
  524. Disposing of Object Pointers
  525. Destructor Methods
  526. The Power of Inheritance
  527. Calling the Ancestor's Init Method
  528. Object Types, Objects and Inheritance
  529. Virtual Methods
  530. Objects containing Virtual Methods Must Have a Constructor
  531. Static versus Virtual:  Which Do You Choose?
  532. Object Types and Type Compatability
  533. Objects as Procedural Parameters
  534. Objects as Typed Constants
  535. Polymorphism
  536. Object Libraries
  537. Designing Object-oriented Programs
  538. Object-oriented Programming Reference
  539. Defining an object
  540. Deriving an object
  541. Object Pointers
  542. Constructor and Destructor Methods
  543. Virtual methods
  544. Using the Self variable
  545. Range Checking of Virtual Method Calls
  546. Glossary of Object Terminology
  547.  
  548.  
  549.  
  550. Chapter 5
  551. Turbo Pascal Graphics
  552.  
  553. Introduction to Turbo Pascal Graphics
  554.      The Graph Unit and Related Files
  555.      Sample Program
  556.      Circles
  557.      Graphic Text
  558. Viewports
  559. The Current Pointer
  560. Selecting Colors
  561. Choosing Colors from the Color Palette
  562. Selecting Interior Colors for Objects
  563. Charting
  564. The Pie Chart
  565. The Bar Chart
  566. The Line Chart
  567. Graphics Drivers and Font Files
  568. Font Files
  569. Linking Device Drivers and Font Files
  570. Converting .BGI and .CHR files into .OBJ files
  571. Two Approaches to Linking .BGI and .CHR Files
  572. Modifying Your Program to Reference the Linked .BGI and .CHR files
  573.  
  574.  
  575.  
  576. Chapter 6
  577. Assembly Language Programming and Turbo Assembler
  578.  
  579. Overview of 80x86 CPU Architecture
  580. Bit representations
  581. Memory Addressing
  582. Turbo Pascal Memory Structure
  583. 80x86 Processor Instruction Set
  584. Direct Memory Address:  The Use of Mem, MemW and MemL
  585. Direct Port Access:  The Use of Port and PortW
  586. The Use of Inline Statements
  587. Encoding Multiple Bytes
  588. The Inline Directive
  589. The Built-in asm Assembler
  590. Using the Built-in Assembler
  591. How Procedures and Functions Are Called
  592. Accessing Global Variables
  593. The Difference Between Constants and Variables
  594. Local Variables in Procedures and Functions
  595. Accessing Value Parameters and Variable Parameters
  596. Function Return Values
  597. Accessing Pointer Variables
  598. Accessing Record Structures
  599. Statement Labels
  600. Jump Instructions
  601. Near and Far RET return instructions
  602. Data Formats and Definitions
  603. Table of Internal Data Representations
  604. DB, DD and DW Directives
  605. Using DB, DW and DD for Multiple Values and Symbols
  606. Assembler Expressions
  607. Turbo Assembler Basics
  608. Turbo Assembler Statements
  609. A Sample Program
  610. Assembling and Compiling
  611. Turbo Assembler Summary
  612.  
  613.  
  614.  
  615. Chapter 7
  616. Debugging Turbo Pascal
  617.  
  618. Program Testing Strategies
  619. Catching Software Defects Before They Happen
  620. Debugging Strategies
  621. Logic errors
  622. Unitialized variables
  623. Unitialized or Erroneous Pointer Values
  624. Changes to Global Variables
  625. Failure to Free Up Dynamically Allocated Memory
  626. Off by 1 Errors
  627. Clobbering Memory and Out of Range Errors
  628. Ignoring Pascal Scoping Rules
  629. Undefined Functions
  630. Check all Return Error Codes
  631. Boundary Conditions
  632. Debugging Techniques
  633. The IDE Debugger
  634. Compiling for the IDE Debugger
  635. Using the Integrated Debugger
  636. Debugger Windows
  637. The Watch Window
  638. Changing the Value of Variables
  639. Using Breakpoints
  640. Other Debug/Breakpoints features
  641. The Debugger Unit
  642. Using Turbo Debugger
  643. Compiling for Turbo Debugger Compatability
  644. Starting Turbo Debugger
  645. The Watch Wndow
  646. Inspector Windows
  647. Evaluate/Modify
  648. Viewing All Variables
  649. Controlling Program Execution
  650. Breakpoints
  651. Setting Breakpoint Options
  652. Inserting Executable Expressions
  653. Changed Memory Global..
  654. Expression True Global...
  655. Viewing Breakpoints
  656. Turbo Debugger and Assembling Language Programs
  657. Protected Mode Debugging on the 80286
  658. Virtual Debugging on the 80386
  659. Starting the Virtual Debugger
  660. Debugging Turbo Vision Applications
  661. Debugging Windows Applications
  662.  
  663.  
  664.  
  665. Chapter 8
  666. Program Optimization and Turbo Profiler
  667.  
  668. Program Optimization
  669. Using the Turbo Profiler
  670. Compiling for Turbo Profiler Compatability
  671. Selecting Program Areas to Profile
  672. Obtaining Accurate Measurements
  673. Improving the Program
  674. Statistics Provided by Turbo Profiler
  675. Turbo Profiler Output Options
  676. Active versus Passive Profiling
  677. Optimization Tricks
  678. Clean Up of Loop Statements
  679. Test for the Most Likely Outcomes First
  680. Set Compiler Options For Most Efficient Execution
  681. Replace Function Calls with Lookup Tables
  682. Don't be Afraid of Goto!
  683. Use Better Algorithms!
  684. Use var Parameters Instead of Value Parameters
  685. Consider Assembly Language
  686. Use Fixed Point Longints in Place of Reals
  687. Increase File I/O Buffers
  688. Memory Reduction
  689. Use Local and Dynamic Variables
  690. Recycle Memory
  691. Using Virtual Memory for Data
  692.  
  693.  
  694.  
  695. Chapter 9
  696. Special Programming Techniques: 8087 Usage, Interrupts and TSRs
  697.  
  698. Using the 80x87 Math Coprocessor
  699. Advantages and Disadvantages
  700. Important Considerations when Using the Coprocessor
  701. Transcendental Functions and the 80387
  702. Other Data Types
  703. Interrupt Handlers and TSRs
  704. Compiling TSR Programs
  705. Installing an Interrupt Handler
  706. Writing the Interrupt Procedure
  707. Use of the Procedure's Register Parameters
  708. Writing Interrupt Procedures using the Assembler Directive
  709. Writing TSRs
  710. TSR Dangers
  711. TSR Interrupt Trapping
  712. TSR Construction
  713. The Main Body of the Program
  714. InstallTSR and the Message Passing Mechanism
  715. Back to InstallTSR
  716. The Keyboard Interrupt Handler
  717. The INT $28 Interrupt Handler
  718. RunPopUp
  719. DoPopUpFunction
  720. DoUnUnstall    
  721. The Timer Interrupt
  722. Debugging TSRs
  723.  
  724.  
  725.  
  726. Chapter 10
  727. Turbo Pascal Standalone Programs
  728.  
  729. BINOBJ
  730. GREP
  731. MAKE
  732. Example Use of MAKE
  733. Explicit Rules
  734. Command Lines
  735. Implicit Rules
  736. Conditional Directives
  737. Using BUILTINS.MAK
  738. Macros
  739. MAKE Command Line Options     
  740. THELP
  741. TOUCH
  742. TPC and BPC - Standalone Turbo Pascal compilers
  743. TEMC The Turbo Editor Macro Compiler 
  744. TDSTRIP
  745. TDUMP
  746.  
  747.  
  748.  
  749. Chapter 11
  750. Turbo Vision Tutorial 
  751.  
  752. What is Turbo Vision?
  753. Learning Turbo Vision
  754. About TVSHELL
  755. A Simple Turbo Vision Application
  756. How does it Run?
  757. Creating the Menu Bar
  758. NewMenu, NewSubMenu and NewItem
  759. NewSubMenu
  760. Hot keys
  761. Command codes
  762. Command Code values
  763. Suggested Exercise
  764. Using the NewLine function
  765. Windows and Views
  766. Turbo Vision Windows
  767. Adding a simple window
  768. TApplication.Init
  769. Adding the Window
  770. Introduction to Dialog Boxes and the HandleEvent Method
  771. Modal versus Non-Modal Dialogs
  772. Radiobuttons and Checkboxes
  773. Tab Order
  774. Introduction to Events and the HandleEvent method
  775. How Events Work
  776. When do you call an ancestor's HandleEvent method?
  777. Keystrokes
  778. Retrieving data from a dialog
  779. Setting Default Values in Dialogs
  780. Getting User Input
  781. The Dialog Data Record
  782. Putting Data into the Dialog
  783. Getting Data
  784. Storing Dialog Data
  785.  
  786.  
  787.  
  788. Chapter 12
  789. Turbo Vision List Boxes
  790.  
  791. List Boxes and Collections
  792. Sidebar:  Introduction to Collections
  793. Creating a TCollection data object
  794. Updating an entry in the collection
  795. Deleting a collection entry
  796. Advanced TCollection retrieval methods
  797. Using Collections in TVSHELL6
  798. Adding items to DirectoryCollection
  799. The List Box Viewer
  800. Creating a List box
  801. Displaying List Box Text with GetText
  802. Summary of TCollection and TListViewer
  803. Finishing the TVSHELL Example Program
  804.      Outline numbering and file selecting
  805.      Scavenge hunts
  806.      Selecting Files and evKeyDown Events
  807.      Mouse Events
  808.      DoSelectFile
  809.      MoveCursor
  810.      DoOpenClose
  811.      Modifying GetText to display Outline numbering
  812.      Finishing TVSHELL
  813.      TShell.RenameDialog Implementation
  814.      TShell.CopyDialog
  815.      The Set Up Program Dialog
  816.      The SetScreenMode Method
  817.      Summary of SetScreenMode
  818.      Disabling Menu Commands
  819. Where to go next
  820.  
  821.  
  822.  
  823. Chapter 13
  824. More Turbo Vision Features
  825.  
  826. Ownership versus Relationship
  827. Z-Order
  828. Views and Event Processing
  829. Selected Views
  830. Events and Event Processing Order
  831. Positional Events
  832. Broadcast Events
  833. User Defined Events
  834. Phased Events
  835. TApplication.Idle:  Writing Background Tasks
  836. Using Color Palettes
  837. Application Color Palettes
  838. The Default Color Palettes
  839. Setting Color Palette Attribute Values
  840. Changing the Default Colors
  841. Common Problems with Color Mapping
  842. Fixing an out of range color problem
  843. Detecting Out of Memory Problems in Turbo Vision
  844. LowMemory and ValidView
  845. ValidView
  846. Setting The Safety Pool Size
  847. Cache Buffers
  848. TView.Valid and TGroup.Valid
  849. Adding On-line Help to Turbo Vision Programs
  850. Step 1:  Writing the on-line help text
  851. Step 2:  Using TVHC to Compile the Help Text
  852. Step 3:  Adapting An Application for On-Line Help
  853.  
  854.  
  855. Chapter 14
  856. Collections
  857.  
  858. Creating a Collection
  859. Adding records to a Collection
  860. How many records are in the Collection?
  861. Retrieving records from the Collection
  862. Updating an entry in the collection
  863. Deleting a collection entry
  864. Disposing the Collection
  865. Strings in TCollection Records
  866. Iterators
  867. ForEach
  868. FirstThat and LastThat
  869. Writing FindName as Method
  870. Other Uses of FirstThat and LastThat
  871. Collections and Memory usage
  872. TSortedCollection
  873. Sort into Descending Order
  874. Using PStrings
  875. Using TSortedCollection.Search
  876. TStringCollection
  877. Overriding Compare for TStringCollection
  878. TStringCollection and Duplicate Entries
  879. Using TStringCollection.Search
  880. Polymorphic Collections
  881.  
  882.  
  883.  
  884. Chapter 15
  885. Streams
  886.  
  887. Stream Types
  888. Using a Stream
  889. The TPersonInfo record for Stream I/O
  890. The Registration Record
  891. The ObjType Field
  892. The VMTLink Field
  893. Load and Store
  894. The Store Method
  895. Registering the stream
  896. All Turbo Vision Objects are Streamable
  897. Reading a Stream
  898.      Defining the Load method and Registration record
  899. The Get Method
  900. Random Access Streams
  901. GetPos, GetSize and Truncate
  902. Streams in EMS Memory:  TEmsStream
  903. Copying Entire Streams
  904. Handling Stream Errors
  905. Polymorphic Streams
  906.  
  907.  
  908.  
  909. Chapter 16
  910. Resources
  911.  
  912. Creating a Database with Resources
  913. Reading data from the Resource file
  914. Storing Program Resources
  915. Using Program Resources
  916. Registering Turbo Vision Components using RegisterXXXX
  917. Creating String Resources
  918. Using String Resources
  919. A String Resource Compiler Utility
  920. Adding Resources to an .EXE File
  921.  
  922.  
  923.  
  924. Chapter 18
  925. ObjectWindows Basics
  926. Chapter written by Namir C. Shammas.
  927.  
  928. Windows Data Types
  929. The ObjectWindows Hierarchy
  930. TObject
  931. TApplication
  932. TWindowsObject
  933. TDialog
  934. TFileDialog
  935. TInputDialog
  936. TWindow
  937. TControl
  938. TScrollBar
  939. TStatic
  940. TEdit
  941. TListBox
  942. TComboBox
  943. TGroupBox
  944. TButton
  945. TCheckBox
  946. TRadioButton
  947. TEditWindow
  948. TFileWindow
  949. Programming Note
  950. TMDIWindow
  951. TMDIClient
  952. TScroller
  953. The Windows API Functions
  954. Invoking Windows API Functions
  955. The Windows Messages
  956. Responding to Messages
  957. Sending Messages
  958. User-defined Messages
  959. Summary
  960.  
  961.  
  962.  
  963. Chapter 19
  964. ObjectWindows Examples
  965. Chapter written by Namir C. Shammas.
  966.  
  967. Resources
  968. The Resource Workshop
  969. Emulating DOS Screen in Windows
  970. The Minimal Windows Application
  971. Using Menus
  972. User Input and Painting Windows
  973. Command Buttons and Text Boxes
  974. A Text File Editor
  975. Summary
  976.  
  977.